/*
 * @Author: zhanglianchang
 * @Date: 2020-08-01 14:39:32
 * @Last Modified by: taoshiwei
 * @Last Modified time: 2019-04-29 14:49:44
 *
 * 题库有关的接口：自己写吧~~  已经被张老师删了 ^_^
 */

// <<<<<<< HEAD

import {createAPI} from "@/utils/request";

// 获取学科
export const addQuestion = data => createAPI("/questions", "post",data);

// 获取学科详情
export const addQuestionDetail = data => createAPI(`/questions/${data.id}`, "GET");

// 修改学科
export const editQuestionDetail = data => createAPI(`/questions/${data.id}`, "put",data);
// =======
// 精选题库列表
export const getQuestions = (data) => createAPI('/questions/choice', 'get', data)

// 精选题库上下架
export const choicePublish = (data) => createAPI(`/questions/choice/${data.id}/${data.publishState}`, 'post', data)

// 试题审核
export const choiceCheck = (data) => createAPI(`/questions/check/${data.id}`, 'post', data)

// 试题审核意见列表
export const auditOpinions = (data) => createAPI(`/questions/${data.id}/auditOpinions`, 'get', data)

// 学科简单列表
export const subjectsName = () => createAPI('/subjects/simple', 'get')
// 基础题库列表
export const Subjects = (data) => createAPI('/questions', 'get', data)
// 录入人列表
export const entryPersonList = () => createAPI('/users/simple', 'get')
// 二级目录
export const subjectsDetailsA = (id) => createAPI(`/directorys/simple?subjectID=${id}`, 'get')
// 标签
export const subjectsDetailsB = (id) => createAPI(`/tags/simple?subjectID=${id}`, 'get')
// 基础题库删除
export const delQuestions = (id) => createAPI(`/questions/${id}`, 'delete')
// 加入精选
export const addChaoice = (id) => createAPI(`/questions/choice/${id}/${1}`, 'PATCH')
// 预览/questions/50?id=50
export const preview = id => createAPI(`/questions/${id}`, 'get')

// 组题列表
export const getRandoms = data => createAPI('/questions/randoms', 'get', data)

// 组题列表删除
export const deleteRandoms = data => createAPI(`/questions/randoms/${data.id}`, 'delete', data)

